The Law of Quadratic Reciprocity
Introduction
- Quadratic reciprocity is one of the most famous results in number theory.
- It describes a deep symmetry between the solvability of $$x^2 \equiv p \pmod q \quad\text{and}\quad x^2 \equiv q \pmod p$$ for odd primes $p$ and $q$.
- At first glance, these two questions seem unrelated.
- The law reveals a hidden pattern that mathematicians found astonishing for centuries.
A Curious Asymmetry… or Is It?
- Suppose $p$ and $q$ are two odd primes.
- You might ask:
- Is $p$ a quadratic residue modulo $q$?
- Is $q$ a quadratic residue modulo $p$?
- These look like two separate questions.
- Early mathematicians computed tables and noticed:
- Sometimes the answers match.
- Sometimes they don’t.
- But the mismatches follow a very specific rule.
- This rule is the Law of Quadratic Reciprocity.
Quadratic Residues Across Different Primes
- For each odd prime $p$, the Legendre symbol is $$\left(\frac{a}{p}\right)$$
- It tells us whether $a$ is a quadratic residue mod $p$. $$\left( \frac{a}{p} \right) = \begin{cases} \;\;1 & \text{if $a$ is a quadratic residue mod $p$ and } a\not\equiv 0 \\ -1 & \text{if $a$ is a non‑residue mod $p$} \\ \;\;0 & \text{if } p \mid a \end{cases}$$
- We are interested in the special case:
- $\left(\frac{p}{q}\right)$
- $\left(\frac{q}{p}\right)$
- These symbols encode the solvability of:
- $x^2 \equiv p \pmod q$
- $x^2 \equiv q \pmod p$
- The surprising fact: these two symbols are almost the same.
Patterns That Seem to Almost Line Up
When you compute small examples, you notice:
- For many pairs of primes $(p,q)$: $$\left(\frac{p}{q}\right) = \left(\frac{q}{p}\right).$$
- But for some pairs: $$\left(\frac{p}{q}\right) = -\left(\frac{q}{p}\right).$$
A pattern emerges:
- The “sign flip” happens exactly when both primes are $\equiv 3 \pmod 4$.
- This is the heart of quadratic reciprocity.
Exploring the Symmetry Through Examples
Example 1: $p=3$, $q=11$
- $3 \equiv 3 \pmod 4$, $11 \equiv 3 \pmod 4$ → both $3 \pmod 4$
- Expect a sign flip.
- Compute:
- Squares mod $11$: $1,4,9,5,3$ → $3$ is a residue → $\left(\frac{3}{11}\right)=1$
- Squares mod $3$: $1$ → $11 \equiv 2$ mod $3$ is not a residue → $\left(\frac{11}{3}\right)=-1$
- Indeed: $1 = -(-1)$.
Example 2: $p=5$, $q=13$
- $5 \equiv 1 \pmod 4$ → no sign flip.
- Compute:
- Squares mod $13$: $1,4,9,3,12,10$ → $5$ is not a residue → $\left(\frac{5}{13}\right)=-1$
- Squares mod $5$: $1,4$ → $13 \equiv 3$ mod $5$ is not a residue → $\left(\frac{13}{5}\right)=-1$
- They match.
The Reciprocity Phenomenon (Informal First Look)
A rough, intuitive version:
- If $p$ and $q$ are odd primes:
- Usually, $p$ is a square mod $q$ if and only if $q$ is a square mod $p$.
- The only time this symmetry breaks is when both primes are of the form $4k+3$.
- In that special case, the answers are opposite.
This is already a remarkable statement.
The Law of Quadratic Reciprocity (Formal Statement)
For distinct odd primes $p$ and $q$: $$\left(\frac{p}{q}\right)\left(\frac{q}{p}\right) = (-1)^{\frac{(p-1)(q-1)}{4}}.$$ This exponent is $1$ exactly when both $p$ and $q$ are $\equiv 3 \pmod 4$.
So the law can be stated more simply:
- If at least one of $p$ or $q$ is $\equiv 1 \pmod 4$, then $$\left(\frac{p}{q}\right) = \left(\frac{q}{p}\right).$$
- If both are $\equiv 3 \pmod 4$, then $$\left(\frac{p}{q}\right) = -\left(\frac{q}{p}\right).$$
The Two Supplementary Laws
Quadratic reciprocity is accompanied by two simpler rules:
1. The First Supplementary Law (for $-1$)
For an odd prime $p$: $$\left(\frac{-1}{p}\right) = \begin{cases} 1 & \text{if } p \equiv 1 \pmod 4,\\ -1 & \text{if } p \equiv 3 \pmod 4. \end{cases}$$
2. The Second Supplementary Law (for $2$)
For an odd prime $p$: $$\left(\frac{2}{p}\right) = \begin{cases} 1 & \text{if } p \equiv \pm 1 \pmod 8,\\ -1 & \text{if } p \equiv \pm 3 \pmod 8. \end{cases}$$ These help compute Legendre symbols quickly.
Why This Law Is So Surprising
- The solvability of $x^2 \equiv p \pmod q$ seems unrelated to $x^2 \equiv q \pmod p$.
- Yet the law shows a precise relationship.
- Historically:
- Gauss called it the “gem of arithmetic”.
- It was the first major theorem to reveal a deep symmetry in number theory.
- It connects:
- Modular arithmetic
- Symmetry
- Prime numbers
- Hidden structure in the integers
A High‑Level Proof Roadmap
There are many proofs (Gauss found eight).
- Gauss’s Lemma approach
- Count how many multiples of $p$ fall into certain intervals modulo $q$.
- Compare with the reverse situation.
- A parity argument gives the reciprocity law.
- Lattice point / geometric approach
- Count points in a rectangle.
- Compare two ways of counting.
- A symmetry argument emerges.
- Finite field approach
- Use properties of multiplicative characters.
- Show that a certain product behaves symmetrically.
Applications and Consequences
Quadratic reciprocity helps with:
- Quickly determining whether $x^2 \equiv a \pmod p$ has a solution.
- Simplifying computations in cryptography (e.g., primality testing).
- Understanding deeper reciprocity laws in algebraic number theory.
- Building intuition for more advanced topics like:
- Dirichlet characters
- Class field theory
- Higher reciprocity laws
Summary and Key Ideas
- Quadratic reciprocity links two seemingly unrelated questions.
- The Legendre symbols $\left(\frac{p}{q}\right)$ and $\left(\frac{q}{p}\right)$ are usually equal.
- They differ only when both primes are $\equiv 3 \pmod 4$.
- Supplementary laws help compute special cases.
- The theorem is a cornerstone of number theory and a gateway to deeper ideas.
Calculator
Legendre
- Checks if a number is a quadratic residue
legendre(2, 7) legendre(3, 7) legendre(14, 7)
Equiv
- Checks if two numbers are congruent modulo $m$
equiv(a, b, modulus) equiv(2, 7, 3) equiv(13, 15, 3)
Exercises
- Compute $\left(\frac{3}{7}\right)$ and $\left(\frac{7}{3}\right)$ and verify quadratic reciprocity.
- Compute $\left(\frac{5}{11}\right)$ and $\left(\frac{11}{5}\right)$.
- Use the supplementary laws to compute $\left(\frac{-1}{19}\right)$ and $\left(\frac{2}{19}\right)$.
- Use quadratic reciprocity to compute $\left(\frac{13}{17}\right)$ without listing squares.
- Determine whether $x^2 \equiv 29 \pmod{43}$ has a solution.
- Explain why the “sign flip” only occurs when both primes are $\equiv 3 \pmod 4$.
- Give an example of primes $p$ and $q$ where $\left(\frac{p}{q}\right)=1$ but $\left(\frac{q}{p}\right)=-1$.
- Show that if $p \equiv 1 \pmod 4$, then $\left(\frac{-1}{p}\right)=1$ using only the definition of quadratic residues.
- For primes $p \equiv 1 \pmod 8$, explain why $2$ must be a quadratic residue modulo $p$.